package com.bfly.mall.order.dto;

import com.bfly.mall.order.enums.ExpressStatusEnum;
import com.bfly.mall.order.enums.OrderStatusEnum;
import com.bfly.mall.order.enums.PayStatusEnum;
import com.bfly.mall.order.enums.PayTypeEnum;
import com.bfly.mall.product.enums.ShippingMethodEnum;

import java.io.Serializable;

/**
 * 订单状态相关DTO
 *
 * @author 长沙商脉科技有限公司
 * @date 2020/9/15 21:10
 */
public class OrderStatusDTO implements Serializable {


    private static final long serialVersionUID = -7381031779174824448L;
    private int orderStatus;
    private int payStatus;
    private int expressStatus;
    private int payType;
    private int dispatchId;

    public String getDispatchName() {
        ShippingMethodEnum dispatchEnum = ShippingMethodEnum.getShippingMethod(getDispatchId());
        return dispatchEnum == null ? "" : dispatchEnum.getName();
    }

    public String getOrderStatusName() {
        OrderStatusEnum status = OrderStatusEnum.getStatus(getOrderStatus());
        return status == null ? "" : status.getName();
    }

    public String getPayStatusName() {
        PayStatusEnum status = PayStatusEnum.getStatus(getPayStatus());
        return status == null ? "" : status.getName();
    }

    public String getExpressStatusName() {
        ExpressStatusEnum status = ExpressStatusEnum.getStatus(getExpressStatus());
        return status == null ? "" : status.getName();
    }

    public String getPayTypeName() {
        PayTypeEnum type = PayTypeEnum.getStatus(getPayType());
        return type == null ? "" : type.getName();
    }

    public int getDispatchId() {
        return dispatchId;
    }

    public void setDispatchId(int dispatchId) {
        this.dispatchId = dispatchId;
    }

    public int getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(int orderStatus) {
        this.orderStatus = orderStatus;
    }

    public int getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(int payStatus) {
        this.payStatus = payStatus;
    }

    public int getExpressStatus() {
        return expressStatus;
    }

    public void setExpressStatus(int expressStatus) {
        this.expressStatus = expressStatus;
    }

    public int getPayType() {
        return payType;
    }

    public void setPayType(int payType) {
        this.payType = payType;
    }
}
